<template>
<div id="header">
  <h1>我是Header，我要使用Store中的数据</h1>
  <div>
    <h4>Store中State的count为{{count}}</h4>
    <h4>Store中State的price为{{price}}</h4>
  </div>
</div>
</template>

<script>
import {mapState} from 'vuex'
export default {
  name: "Header",
  computed:{
    ...mapState(['count','price'])
  }
}
</script>

<style scoped>
#header{
  margin: 20px auto;
  width: 800px;
  height: 200px;
  background-color: pink;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
</style>